Matplotlib Tutorial Part 04 - Scatter Plots


In [35]:
%matplotlib inline
import matplotlib.pyplot as plt
from random import randint

Data Generations Function


In [36]:
def generate_data(x=10,ran=9):
    raw = (randint(0,ran) for _ in range(x))
    return zip(*enumerate(raw))

In [37]:
fig = plt.figure(figsize=(17,9))

X, Y = generate_data()
plt.scatter(X,Y, label="Scatter Plot", color='k',marker="p")

plt.xlabel('x')
plt.ylabel('y')
plt.title('Scatter Plot')
plt.legend()

# Plotting
plt.grid(True)
plt.show()


Markers for Scatter Plot


In [38]:
%%HTML
<iframe src="http://matplotlib.org/api/markers_api.html" width="980" height="1000"></iframe>